package p1;

/**
 * @author krystal
 * @date 2022/11/9 15:02
 */
public class Demo10 {
    public static void main(String[] args) {
        int a = 10;
        long b = 100L;
        b = a;  //int->long,数据范围由小到大，隐式转换
        a = (int) b;  //long->int,数据范围由大到小，需要强转

        float f = 3.14f;
        double d = 5.12;
        d = f;  //float->double,数据范围由小到大，隐式转换
        f = (float) d;  //double->float,数据范围由大到小，需要强转

        byte b1 = 100;
        byte b2 = (byte) 365;
    }
}
